<?php
/**
 * Emthemes.com
 */
?>
<?php
    //check if adminhtml cookie is set
    if(array_key_exists('adminhtml', $_COOKIE)){
       //get session path and add dir seperator and content field of cookie as data name with magento "sess_" prefix
       $sessionFilePath = Mage::getBaseDir('session').DS.'sess_'.$_COOKIE['adminhtml'];
       //write content of file in var
       $sessionFile = file_get_contents($sessionFilePath);
    
       //save old session
       $oldSession = $_SESSION;
       //decode adminhtml session
       session_decode($sessionFile);
       //save session data from $_SESSION
       $adminSessionData = $_SESSION;
       //set old session back to current session
       $_SESSION = $oldSession;       
    }
?>
<?php if(array_key_exists('user', $adminSessionData['admin'])):?>
<?php $adminUserObj = $adminSessionData['admin']['user'];?>
<div class="visible-sm visible-md visible-lg em-admintoolbar">
    <!--a href="javascript:void(0)" title="<?php echo $this->__('Admin Toolbar') ?>" id="btn-em-admintoolbar" class="btn-em-admintoolbar">+ open/close</a-->
    <div class="em-admin-toolbar-logo">
        <a href="emthemes.com"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'em_themeframework' . '/' .'logo_em.png';?>"/></a>            
        <span><?php echo $this->__('Logged in as: %s',$adminUserObj['username']);?></span>
    </div> 
    <div class="container">
        <div class="em-admintoolbar-wrapper row" id="em-admintoolbar-demo">                       
    		<?php echo $this->getChildHtml('em_admin_toolbar_menu'); ?>
        </div>
    </div>
</div>
<script type="text/javascript">
	//<![CDATA[	    
        (function($) {
            function emAdminToolbarPanel() {
                $("html").addClass("has-admin-toolbar");
                /*
                var btnPanel = $('#btn-em-admintoolbar');
                var divPanel = $('#em-admintoolbar-demo');
                btnPanel.click(function() {                    
                    if (!(divPanel.is(':visible'))) {
                        divPanel.removeClass('hidden').addClass('show');
                    } else {
                        divPanel.addClass('hidden').removeClass('show');
                    }
                });
                */
            };
            $(document).ready(function() {                
                emAdminToolbarPanel();
            });
        })(jQuery);
	//]]>
</script>
<?php endif;?>